﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using DiBang.Common;
using DiBang.Sql;

namespace ChangWuDiBang
{
    public partial class FrmDiBangSel : Office2007Form
    {
        public DataTable _DataTable
        {
            get;
            set;
        }

        public DiBangInfo _DiBangInfo
        {
            get;
            set;
        }


        public FrmDiBangSel()
        {
            this.EnableGlass = false;
            InitializeComponent();
        }

        private void FrmDiBangSel_Load(object sender, EventArgs e)
        {
            dgvDiBang.DataSource = _DataTable;
        }

        private void dgvDiBang_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvDiBang.CurrentRow!=null)
            {
                _DiBangInfo.ChengZhongDate=dgvDiBang.CurrentRow.Cells["CHENG_DATE"].ToString();
                _DiBangInfo.PinMing=dgvDiBang.CurrentRow.Cells["PIN_MING"].ToString();
                _DiBangInfo.CheHao=dgvDiBang.CurrentRow.Cells["CHE_HAO"].ToString();
                _DiBangInfo.ChengZhong=dgvDiBang.CurrentRow.Cells["WEIGHT"].ToString();
                _DiBangInfo.MaoZhong=dgvDiBang.CurrentRow.Cells["MaoZhong"].ToString();
                _DiBangInfo.PiZhong=dgvDiBang.CurrentRow.Cells["PiZhong"].ToString();
                _DiBangInfo.RongQiNum=dgvDiBang.CurrentRow.Cells["RongQiNum"].ToString();
                _DiBangInfo.RongQiZhong=dgvDiBang.CurrentRow.Cells["RongQiZhong"].ToString();
                _DiBangInfo.JingZhong=dgvDiBang.CurrentRow.Cells["JingZhong"].ToString();
                _DiBangInfo.ChengZhongOther=dgvDiBang.CurrentRow.Cells["OTHER"].ToString();
                _DiBangInfo.LastEventTimeKey = dgvDiBang.CurrentRow.Cells["LAST_EVENT_TIMEKEY"].ToString(); 
                //dgvDiBang.CurrentRow.Cells["IMAGE_ID"].ToString();
                //dgvDiBang.CurrentRow.Cells["CompleteFlag"].ToString();
                //dgvDiBang.CurrentRow.Cells["CREATE_USER_ID"].ToString();
                //dgvDiBang.CurrentRow.Cells["CREATE_TIME"].ToString();
                //dgvDiBang.CurrentRow.Cells["LAST_EVENT_NAME"].ToString();
                //dgvDiBang.CurrentRow.Cells["LAST_EVENT_USER_ID"].ToString();

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
    }
}
